package net.sky.oa.model;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

@Entity
@Table(name = "MAIL_BOX")
public class MailBox {
	
	  private Long id;
	  private Date sendTime;
	  private Short delflag;
	  private Integer readflag;
	  private String note;
	  private Mail mail;
	  private MailFolder mailfolder;
	  private Integer replyFlag;
	  private SysEmployee user;
	  
	
	@Id 
	@SequenceGenerator(name="SQ_MAILBOX_ID",sequenceName="SQ_MAILBOX_ID",allocationSize=1)
	@GeneratedValue(strategy=GenerationType.SEQUENCE,generator="SQ_MAILBOX_ID")
	@Column(name = "ID", unique = true, nullable = false)   
	public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "SENDTIME")
	public Date getSendTime() {
		return sendTime;
	}
	public void setSendTime(Date sendTime) {
		this.sendTime = sendTime;
	}
	@Column(name = "DELFLAG")
	public Short getDelflag() {
		return delflag;
	}
	public void setDelflag(Short delflag) {
		this.delflag = delflag;
	}
	@Column(name = "READFLAG")
	public Integer getReadflag() {
		return readflag;
	}
	public void setReadflag(Integer readflag) {
		this.readflag = readflag;
	}
	@Column(name = "NOTE")
	public String getNote() {
		return note;
	}
	public void setNote(String note) {
		this.note = note;
	}
	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "MAILID")
	public Mail getMail() {
		return mail;
	}
	public void setMail(Mail mail) {
		this.mail = mail;
	}
	
	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "FOLDERID")
	public MailFolder getMailfolder() {
		return mailfolder;
	}
	public void setMailfolder(MailFolder mailfolder) {
		this.mailfolder = mailfolder;
	}
	@Column(name = "REPLYFLAG")
	public Integer getReplyFlag() {
		return replyFlag;
	}
	public void setReplyFlag(Integer replyFlag) {
		this.replyFlag = replyFlag;
	}
	
	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "USER_ID")
	public SysEmployee getUser() {
		return user;
	}
	public void setUser(SysEmployee user) {
		this.user = user;
	}
   
	
	  
	  
}
